package com.zdft.promotion.logging.service.api;

import com.zdft.promotion.common.model.QueryResultModel;
import com.zdft.promotion.common.service.BusinessException;
import com.zdft.promotion.logging.OperationLogFilterModel;
import com.zdft.promotion.logging.bean.OperationLogBean;

import java.lang.reflect.Method;
import java.util.Date;

/**
 * Created by Administrator on 2019/2/21.
 */
public interface IOperationLogService
{
    /**
     * 异步记录API操作日志
     * 目前先使用线程池实现，大并发场景再考虑加入K队列处理
     *
     * @param method      方法签名
     * @param paramValue  入参
     * @param returnValue 出参
     * @param operator    操作人
     * @param operateTime 操作时间
     */
    void asyncAddOperationLog(Method method, String paramValue, String returnValue, String operator, Date operateTime)
            throws BusinessException;

    /**
     * 条件查询操作日志集
     *
     * @param filter 查询条件
     * @return 结果集
     */
    QueryResultModel<OperationLogBean> queryOperationLog(OperationLogFilterModel filter);

    /**
     * 加载操作日志信息
     *
     * @param id PK
     * @return 对象
     * @throws BusinessException
     */
    OperationLogBean loadOperationLog(Long id) throws BusinessException;

    /**
     * 删除操作日志信息
     *
     * @param id PK
     * @throws BusinessException
     */
    void deleteOperationLog(Long id) throws BusinessException;
}
